import request, { baseURL } from '../utils/axios';

export function getFullPath(path){
	if ( !path ) return;
	path = path.replace(/\s/g, encodeURIComponent(' '));
	return baseURL + '/file/upload/getFileByPath?filePath=' + path;
}
export function getOptional(data={}){
    return request({
		url: '/websiteBack/getDropdownList',
		method: 'get',
		params:data
	});
}

// 用户操作记录
export function applyDemand(data = {}){
    return request.post('/websiteFront/addDemand', { ...data });  
}
export function markAction(data={}){
    return request({
		url: '/websiteFront/operationLog',
		method: 'get',
		params:data
	});
}
// 产品中心
export function getAppTypeList(data) {
	return request({
		url: '/applicationInfo/appType/list',
		method: 'get',
		params:data
	});
}
export function getAppList(data) {
	return request.post('/applicationInfo/query/list', { ...data });
}
export function getAppDetail(data) {
	return request({
		url: '/applicationInfo/getById/' + data.id,
		method: 'get',
		params:data
	});
}
export function getVersionList(data) {
	return request.post('/app/version/query/list', { ...data });
}
export function getServiceDetail(data) {
	return request({
		url: '/serviceInfo/getServiceInfoByCode/' + data.id,
		method: 'get',
	});
}
// 碳交易服务
export function getServiceList(data) {
	return request({
		url: '/serviceInfo/getServiceInfoList',
		method: 'get',
		params:data
	});
}

// 硬件
export function getEquipmentList(data) {
	return request.post('/websiteFront/equipmentMallList', { ...data });
}
export function getEquipmentDetail(data) {
	return request({
		url: 'websiteFront/detailEnergyEquipmentMallWebsite',
		method: 'get',
		params:data
	});
}
export function getRecommendList(data) {
	return request.post('/equipment/mall/query/list', { ...data } );
}
// 成功案例
export function getContentList(data={}){
    return request({
		url: '/websiteBack/getContentInfoList',
		method: 'get',
		params:data
	});
}
// 动态
export function getViewCount(data={}){
    return request({
		url: '/websiteFront/contentReadCount',
		method: 'get',
		params:data
	});
}

// {
//     "code": 200,
//     "message": "成功",
//     "total": 0,
//     "pageCount": 0,
//     "data": {
//         "dataTypeList": [
//             "访客量",
//             "浏览量",
//             "留言量",
//             "IFMCS链接点击量",
//             "开放平台点击量"
//         ],
//         "operationTypeList": [
//             "访问网站",
//             "点击提交表单",
//             "进入厂务",
//             "进入开放平台"
//         ],
//         "contentTypeList": [
//             "首页产品轮播",
//             "案例",
//             "动态"
//         ],
//         "informationList": [
//             "华翊动态",
//             "行业深度",
//             "沙龙活动",
//             "产品咨询"
//         ],
//         "caseTypeList": [
//             "智慧能源",
//             "智慧安全",
//             "智慧环境",
//             "智慧运维"
//         ],
//         "demandList": [
//             "系统演示",
//             "商情合作",
//             "定制开发",
//             "其他"
//         ]
//     }
// }

